//
//  LoginView.m
//  豆瓣
//
//  Created by liuxin on 15/10/26.
//  Copyright (c) 2015年 liuxin. All rights reserved.
//

#import "LoginView.h"
#import "RegisterViewController.h"
@implementation LoginView
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        [self createSubView];
    }
    return self;
}
-(void)createSubView{
    UILabel *username = [[UILabel alloc]initWithFrame:CGRectMake(50, 100, 80, 30)];
    username.text = @"用户名:";
    [self addSubview:username];
    [username release];
    
    self.username = [[UITextField alloc]initWithFrame:CGRectMake(120, 100, 200, 30)];
    self.username.borderStyle = UITextBorderStyleRoundedRect;
    self.username.placeholder = @"please input username";
    self.username.clearButtonMode = UITextFieldViewModeAlways;
//    self.username.backgroundColor = [UIColor grayColor];
    [self addSubview:self.username];
    [_username release];
    
    UILabel *password = [[UILabel alloc]initWithFrame:CGRectMake(50, 150, 80, 30)];
    password.text = @"密  码:";
    [self addSubview:password];
    [password release];
    
    self.password = [[UITextField alloc]initWithFrame:CGRectMake(120, 150, 200, 30)];
    self.password.borderStyle = UITextBorderStyleRoundedRect;
    self.password.placeholder = @"please input password";
    self.password.secureTextEntry = YES;
    self.password.clearButtonMode = UITextFieldViewModeAlways;
//    self.password.backgroundColor = [UIColor grayColor];
    [self addSubview:self.password];
    [_password release];
    
   self.Login = [UIButton buttonWithType:UIButtonTypeCustom];
    self.Login.frame = CGRectMake(70, 240, 80, 30);
    [self addSubview:self.Login];
    self.Login.backgroundColor = [UIColor colorWithRed:0.200 green:0.826 blue:0.280 alpha:1.000];
    [self.Login setTitle:@"登录" forState:UIControlStateNormal];
    self.Login.layer.cornerRadius = 8.0;
  
    
   self.Register = [UIButton buttonWithType:UIButtonTypeCustom];
    self.Register.frame = CGRectMake(200, 240, 80, 30);
    [self addSubview:self.Register];
    self.Register.backgroundColor = [UIColor colorWithRed:1.000 green:0.488 blue:0.210 alpha:1.000];
    self.Register.layer.cornerRadius = 8.0;
    [self.Register setTitle:@"注册" forState:UIControlStateNormal];
    
   
}

@end
